package evolution.cli;

import java.io.File;

import evolution.VersionedDirectoryTree;
import evolution.VersionedDirectoryTreeBuilder;
import evolution.VersionedDirectoryTreeStatus;


public class StatusCommand implements Command
{
	private final VersionedDirectoryTreeBuilder builder;

	public StatusCommand(VersionedDirectoryTreeBuilder builder)
	{
		this.builder = builder;
	}

	public void execute(String[] args) throws Exception
	{
		VersionedDirectoryTree vdt = builder.buildRepository(new RootFileSystemDirectory(new File(System.getProperty("user.dir"))));
		VersionedDirectoryTreeStatus status = vdt.getStatus();
		System.out.println(status.countModifiedFiles() + " modified files");
	}

}
